package sanshi.contect.udpstarter.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import sanshi.contect.udpstarter.client.UDPClient;

import java.nio.charset.StandardCharsets;

@RestController
public class SendUdpMsgController {

    @Autowired
    private UDPClient client;

    @GetMapping("/test")
    public String sendMSg(){
        String msg = "成都";

        client.send(msg.getBytes(StandardCharsets.UTF_8));
        return "success";
    }




}
